<?php
 
require('./config/config.php');
require('./classes/deck.php');

print_r($_POST);

$name = $_POST["name"];
$shortDescription = $_POST["shortDescription"];
$description = $_POST["description"];
$status = $_POST["status"];
$themeID = $_POST["themeID"];

echo "<br />name: " . $name . "<br />";
echo "shortDescription: " . $shortDescription . "<br />";
echo "description: " . $description . "<br />";
echo "status: " . $status . "<br />";
echo "themeID: " . $themeID . "<br />";

$deck = new DOMDocument("1.0", "UTF-8");
$xmlroot = $deck->createElement("deck");
$xmlroot = $deck->appendChild($xmlroot);

$xmlroot->appendChild($deck->createElement("id",""));
$xmlroot->appendChild($deck->createElement("name",$name));
$xmlroot->appendChild($deck->createElement("description",$description));
$xmlroot->appendChild($deck->createElement("shortDescription",$shortDescription));
$xmlroot->appendChild($deck->createElement("status",$status));
$xmlroot->appendChild($deck->createElement("themeID",$themeID));
   		
$data = new pmtData($dbHost, $dbUser, $dbPass, $dbName);
$id = $data->setDeck($deck);

echo "<br /<br />Het is gelukt!<br />ID: " . $id

?>